*** Stata 15 reproduction code for

*Mader, Matthias & Harald Schoen.
*What a difference an event can make: The European refugee crisis, party competition, and voters’ responses in Germany
*West European Politics

	
*** Table 2: Change in immigration and welfare attitudes
**********************************************************

use "DATA_wide.dta", clear

	*Imigration attitudes
	fre tri2_diff_immi_71 tri2_diff_immi_107 tri2_diff_immi_1710 if filter_table2 == 1 // stable means <= 1 scale point change
	fre tri1_diff_immi_71 tri1_diff_immi_107 tri1_diff_immi_1710 if filter_table2 == 1  // stable means totally stable

	*Welfare attitudes:
	fre tri2_diff_welfare_71 tri2_diff_welfare_107 tri2_diff_welfare_1710 if filter_table2 == 1 // stable means <= 1 scale point change
	fre tri1_diff_welfare_71 tri1_diff_welfare_107 tri1_diff_welfare_1710  if filter_table2 == 1  // stable means totally stable

	
*** Table 3: Change in perceived party positions and policy distances
***********************************************************************

use "DATA_wide.dta", clear
	
	*change in perceptions
	fre tri2_diff6_p_cdu11 if filter_table3 == 1 // CDU, among all
	tab tri2_immi6 tri2_diff6_p_cdu11 if filter_table3 == 1 , row nof // CDU, by immigration attitude

	fre tri2_diff6_p_csu11 if filter_table3 == 1  // CSU, among all
	tab tri2_immi6 tri2_diff6_p_csu11 if filter_table3 == 1 , row nof // CSU, by immigration attitude
	
	*change in absolute distance
	fre tri2_diff6_adist_cdu11 if filter_table3 == 1  // CDU, among all
	tab tri2_immi6 tri2_diff6_adist_cdu11 if filter_table3 == 1 , row  // CDU, by immigration attitude

	fre tri2_diff6_adist_csu11 if filter_table3 == 1  // CSU, among all
	tab tri2_immi6 tri2_diff6_adist_csu11 if filter_table3 == 1 , row nof  // CSU, by immigration attitude
